package Parser;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Map;
import java.util.TreeMap;

import org.supercsv.io.CsvMapReader;
import org.supercsv.io.ICsvMapReader;
import org.supercsv.prefs.CsvPreference;

public class ReaderCSV {

	public static void main(String[] args) {
		ReaderCSV reader = new ReaderCSV();
		try {
			System.out.println(reader.getMetricsMap("Files/classes3_1.csv"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public Map<String, String> getMetricsMap(String path) throws IOException {
		File file = new File(path);
		FileReader fileReader = new FileReader(file.getAbsolutePath());
		ICsvMapReader reader = new CsvMapReader(fileReader,
				CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE);
		String[] header = reader.getCSVHeader(true);
		return reader.read(header);
	}

}
